package services;

import dao.SuppliecharacterDao;
import model.Suppliecharacter;

import java.util.List;

public class SuppliecharacterService {
    SuppliecharacterDao suppliecharacterDao = new SuppliecharacterDao();//对suppliecharacter表进行实例化操作

    /**
     * 对suppliecharacter表进行添加操作
     *
     * @param suppliecharacter 实体
     * @return 添加是否成功
     */
    public int add(Suppliecharacter suppliecharacter) {//
        System.out.println("进入添加业务流程");
        int num = 0;//设置返回类型默认值
        num = suppliecharacterDao.add(suppliecharacter);//对dao层add方法进行调用  返回添加结果
        return num;//
    }

    /**
     * 对suppliecharacter表进行修改操作
     * @param suppliecharacter 实体
     * @return 修改是否成功
     */
    public int update(Suppliecharacter suppliecharacter){
        System.out.println("进入更改方法");
        int isSuccess=0;//更新未成功
        isSuccess=suppliecharacterDao.update(suppliecharacter);  //去dao层找update函数
        return isSuccess;
    }

    /**
     * 对suppliecharacter表进行删除操作
     * @param suppliecharacter 实体
     * @return 删除是否成功
     */
    public int del(Suppliecharacter suppliecharacter){
        int isDel=0;//删除未成功
        isDel=suppliecharacterDao.del(suppliecharacter);   //去dao层找del函数
        return isDel;
    }

    /**
     * 对suppliecharacter表进行查询操作
     * @param suppliecharacter 实体
     * @return
     */
    public List<Suppliecharacter> getAll(Suppliecharacter suppliecharacter){
        List<Suppliecharacter> listSuppliecharacter=suppliecharacterDao.getAll(suppliecharacter);//调用dao层的getall方法 返回查询结果
        return listSuppliecharacter;
    }
    public List<Suppliecharacter> getDan(Suppliecharacter suppliecharacter){
        List<Suppliecharacter> listSuppliecharacter=suppliecharacterDao.getDan(suppliecharacter);//调用dao层的getall方法 返回查询结果
        return listSuppliecharacter;
    }

    public List<Suppliecharacter> getAddc(Suppliecharacter suppliecharacter){
        List<Suppliecharacter> listSuppliecharacter=suppliecharacterDao.getAddc(suppliecharacter);//调用dao层的getall方法 返回查询结果
        return listSuppliecharacter;
    }
}
